<form name="form" class="meta-container meta-container-60">
    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 detail-block">
        <div class="meta-no-margin person-info-block">
            <div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 col-lg-4 meta-no-padding">
                <div class="avatar"
                     ng-style="{'background-image':'url('+(user.avatar ||'images/common/header.png')+')'}"></div>
            </div>
            <div class="col-lg-8 col-md-8 col-sm-8 col-xs-8">
                <!-- 基本信息的填写表单 -->
                <div class="form-horizontal">
                    <div class="form-group">
                        <label for="" class="col-sm-2 control-label">
                            姓名
                        </label>

                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="" placeholder="姓名" ng-model="user.name"
                                   readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="talentTitle" class="col-sm-2 control-label">职称</label>

                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="talentTitle" placeholder="职称"
                                   ng-model="talent.title">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="talentOrganization" class="col-sm-2 control-label">所属机构</label>

                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="talentOrganization"
                                   ng-model="talent.organization" placeholder="所属机构">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="talentDepartment" class="col-sm-2 control-label">所属部门</label>

                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="talentDepartment"
                                   ng-model="talent.department" placeholder="所属部门">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="talentDisciplineClass" class="col-sm-2 control-label">所属学科</label>

                        <div class="col-sm-5">
                            <select class="form-control" id="talentDisciplineClass" ng-model="talent.disciplineClass"
                                    name="disciplineClass"
                                    ng-options="option for option in disciplineClasses"
                                    required>
                            </select>
                        </div>
                        <div class="col-sm-5">
                            <select class="form-control" ng-model="talent.discipline"
                                    name="talentDiscipline"
                                    ng-options="option for option in disciplines[talent.disciplineClass]"
                                    required>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="talentUserMobile" class="col-sm-2 control-label">联系电话</label>

                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="talentUserMobile" placeholder="联系电话"
                                   ng-model="user.mobile"
                                   readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="talentUserEmail" class="col-sm-2 control-label">电子邮箱</label>

                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="talentUserEmail" placeholder="电子邮箱"
                                   ng-model="user.email"
                                   readonly>
                        </div>
                    </div>
                    <!--<div class="form-group">-->
                    <!--<div class="col-sm-offset-10 col-sm-2">-->
                    <!--<button type="submit" class="btn btn-default">保存</button>-->
                    <!--</div>-->
                    <!--</div>-->
                    <div class="form-group">
                        <button class="col-sm-offset-10 btn btn-default" type="button" ng-click="talentUpdate()">提交修改
                        </button>
                    </div>
                </div>
            </div>
            <div class="clearfix"></div>

        </div>
        <div class="meta-container-60" style="margin-top:0">
            <h4>科研关键字</h4>
            <hr/>
            <div class="form-group">
                <div class="col-sm-8" style="padding:0">
                    <input class="form-control" type="text" placeholder="请以空格分割" meta-form-keywords="talent.keywords"/>
                </div>
                <div class="col-sm-4">
                    <button type="button" class="btn btn-default" ng-click="talentUpdate()">确认添加</button>
                    <small style="color:#999">可添加多个关键字，用空格隔开</small>
                </div>
            </div>
            <div class="clearfix"></div>
            <ul class="talent-edit-keywords" style="list-style:none;margin:10px 0;padding:0">
                <li class="talent-edit-keyword" ng-repeat="element in talent.keywords track by $index"
                    style="border:1px solid #ddd;padding:5px;margin-right:5px;float:left;color:#999">{{element}}

                    &nbsp;&nbsp;<span ng-click="removeKeyword($index)" class="glyphicon glyphicon-remove-circle"
                                      style="color:#ddd;cursor:pointer"></span>
                </li>
                <li class="clearfix"></li>
            </ul>
        </div>
        <div class="meta-container-60 person-base-intro">
            <h4>简介</h4>
            <hr/>
            <div class="form-group">
                <textarea class="form-control" placeholder="简要介绍" ng-model="talent.brief"
                          froala="CONFIG.froalaOptions"></textarea>
            </div>
            <div class="form-group">
                <button type="button" class="btn btn-default" ng-click="talentUpdate()">提交修改</button>
            </div>
        </div>
        <div class="meta-container-60">
            <h4>研究方向<span ng-bind="researchAreas ? '(' + researchAreas.length + ')' : ''"></span></h4>
            <hr/>
            <div>
                <div class="form-group">
                    <input class="form-control" placeholder="研究方向标题" name="researchAreaNewName"
                           ng-model="researchAreaNew.name"
                           ng-class="{'error-input': form.researchAreaNewName.$invalid}"
                           required/>
                </div>
                <div class="form-group">
                    <textarea class="form-control" placeholder="研究方案内容" name="researchAreaNewContent"
                              ng-model="researchAreaNew.content"
                              ng-class="{'error-input': form.researchAreaNewContent.$invalid}"
                              required></textarea>
                </div>
                <div class="form-grout">
                    <button type="button" class="btn btn-default" ng-click="addResearchArea()">添加研究方向</button>
                </div>
            </div>
            <hr/>
            <div ng-repeat="area in researchAreas track by $index" style="margin: 20px 0">
                <div ng-show="editing.areas!==$index">
                    <div style="float:left">
                        <h4 ng-bind="area.name"></h4>
                    </div>
                    <div style="float:right">
                        <a href="javascript:void(0)" ng-click="editResearchArea(area, $index)">编辑</a>
                        <a href="javascript:void(0)" ng-click="deleteResearchArea(area.id, $index)">删除</a>
                    </div>
                    <div class="clearfix"></div>
                    <p ng-bind="area.content"></p>
                </div>
                <div ng-show="editing.areas === $index">
                    <div style="float:left">
                        <div class="form-group">
                            <input class="form-control" ng-model="temp.areaUpdate.name">
                        </div>
                    </div>
                    <!--<div style="float:right">-->
                    <!--<a href="javascript:void(0)" ng-click="editing.areas[$index]=false">完成</a>-->
                    <!--</div>-->
                    <div class="clearfix"></div>
                    <div class="form-group">
                        <textarea class="form-control" ng-model="temp.areaUpdate.content"></textarea>
                    </div>
                    <div>
                        <button type="button" class="btn btn-default" ng-click="updateResearchArea(area.id, $index)">
                            保存修改
                        </button>
                        <button type="button" class="btn btn-default" ng-click="cancelResearchArea()">
                            取消修改
                        </button>
                        <!--<button type="button" class="btn btn-default">取消修改</button>-->
                    </div>
                </div>
                <hr>
            </div>
        </div>
        <div id="talent-sub" class="meta-container-60" style="margin-bottom:120px;">
            <ul class="nav-tabs" style="margin-bottom:10px;">
                <li><a class="uib-tab" ng-class="{'active': index===0}"
                       ng-click="index=0">项目{{projectData.length|| 0}}</a></li>
                <li><a class="uib-tab" ng-class="{'active': index===1}"
                       ng-click="index=1">专利{{patentData.length || 0}}</a></li>
                <li><a class="uib-tab" ng-class="{'active': index===2}"
                       ng-click="index=2">论文{{paperData.length || 0}}</a></li>
                <li class="clearfix"></li>
            </ul>

            <div class="tab-pane" ng-show="index===0">
                <div>
                    <div class="form-group">
                        <input class="form-control" name="projectNewTitle" placeholder="项目标题"
                               ng-model="projectNew.title"
                               ng-class="{'error-input': form.projectNewTitle.$invalid}"
                               required/>
                    </div>
                    <div class="form-group">
                        <meta-single-qnuploader uploader-config="CONFIG.qnuploader"
                                                uploader-data="projectNew.attachments[0]"></meta-single-qnuploader>
                    </div>

                    <div class="form-group">
                        <textarea class="form-control" placeholder="项目详情" ng-model="projectNew.content"></textarea>
                    </div>
                    <div class="form-group">
                        <button type="button" class="btn btn-default" ng-click="addProject()">添加项目</button>
                    </div>
                </div>
                <hr/>
                <ul class="edit-person-works">
                    <li ng-repeat="element in projectData track by $index">
                        <div ng-show="editing.projects !== $index">
                            <div class="works-title">
                                <h4>{{element.title}}
                                    <small><a
                                        ng-href='{{element.attachments[0].link + "?download/" + element.attachments[0].name}}'
                                        ng-show='element.attachments[0]!==undefined'
                                        ng-bind="element.attachments[0].name"
                                        target="_blank"></a>
                                    </small>
                                </h4>
                            </div>
                            <div class="works-operation">
                                <a href="javascript:void(0)" ng-click="editProject(element, $index)">编辑</a>
                                <a href="javascript:void(0)" ng-click="deleteProject(element.id, $index)">删除</a>
                            </div>

                            <div class="clearfix"></div>
                            <p ng-bind="element.content"></p>
                        </div>
                        <div ng-show="editing.projects === $index">
                            <div class="works-title">
                                <div class="form-group">
                                    <input class="form-control" ng-model="temp.projectUpdate.title"
                                           name="projectUpdateTitle"
                                           ng-class="{'error-input': form.projectUpdateTitle.$invalid}"
                                           required placeholder="项目标题"/>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                            <div class="form-group">
                                <meta-single-qnuploader uploader-config="CONFIG.qnuploader"
                                                        uploader-data="temp.projectUpdate.attachments[0]"></meta-single-qnuploader>
                            </div>

                            <div class="form-group">
                                <textarea class="form-control" ng-model="temp.projectUpdate.content"
                                          placeholder="项目详情"></textarea>
                            </div>

                            <div class="form-group">
                                <button type="button" class="btn btn-default"
                                        ng-click="updateProject(element.id, $index)">保存修改
                                </button>
                                <button type="button" class="btn btn-default" ng-click="cancelProject()">取消修改</button>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
            <div class="tab-pane" ng-show="index===1">
                <div>
                    <div class="form-group">
                        <input class="form-control" name="patentNewTitle" placeholder="专利标题"
                               ng-model="patentNew.title"
                               ng-class="{'error-input': form.patentNewTitle.$invalid}"
                               required/>
                    </div>
                    <div class="form-group">
                        <meta-single-qnuploader uploader-config="CONFIG.qnuploader"
                                                uploader-data="patentNew.attachments[0]"></meta-single-qnuploader>
                    </div>

                    <div class="form-group">
                        <textarea class="form-control" placeholder="专利详情" ng-model="patentNew.content"></textarea>
                    </div>
                    <div class="form-group">
                        <button type="button" class="btn btn-default" ng-click="addPatent()">添加专利</button>
                    </div>
                </div>
                <hr/>
                <ul class="edit-person-works">
                    <li ng-repeat="element in patentData track by $index">
                        <div ng-show="editing.patents !== $index">
                            <div class="works-title">
                                <h4>{{element.title}}
                                    <small><a
                                        ng-href='{{element.attachments[0].link + "?download/" + element.attachments[0].name}}'
                                        ng-show='element.attachments[0]!==undefined'
                                        ng-bind="element.attachments[0].name"
                                        target="_blank"></a>
                                    </small>
                                </h4>
                            </div>
                            <div class="works-operation">
                                <a href="javascript:void(0)" ng-click="editPatent(element, $index)">编辑</a>
                                <a href="javascript:void(0)" ng-click="deletePatent(element.id, $index)">删除</a>
                            </div>

                            <div class="clearfix"></div>
                            <p ng-bind="element.content"></p>
                        </div>
                        <div ng-show="editing.patents === $index">
                            <div class="works-title">
                                <div class="form-group">
                                    <input class="form-control" ng-model="temp.patentUpdate.title"
                                           name="patentUpdateTitle"
                                           ng-class="{'error-input': form.patentUpdateTitle.$invalid}"
                                           required placeholder="专利标题"/>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                            <div class="form-group">
                                <meta-single-qnuploader uploader-config="CONFIG.qnuploader"
                                                        uploader-data="temp.patentUpdate.attachments[0]"></meta-single-qnuploader>
                            </div>

                            <div class="form-group">
                                <textarea class="form-control" ng-model="temp.patentUpdate.content"
                                          placeholder="专利详情"></textarea>
                            </div>

                            <div class="form-group">
                                <button type="button" class="btn btn-default"
                                        ng-click="updatePatent(element.id, $index)">保存修改
                                </button>
                                <button type="button" class="btn btn-default" ng-click="cancelPatent()">取消修改</button>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
            <div class="tab-pane" ng-show="index===2">
                <div>
                    <div class="form-group">
                        <input class="form-control" name="paperNewTitle" placeholder="论文标题"
                               ng-model="paperNew.title"
                               ng-class="{'error-input': form.paperNewTitle.$invalid}"
                               required/>
                    </div>
                    <div class="form-group">
                        <meta-single-qnuploader uploader-config="CONFIG.qnuploader"
                                                uploader-data="paperNew.attachments[0]"></meta-single-qnuploader>
                    </div>

                    <div class="form-group">
                        <textarea class="form-control" placeholder="项目详情" ng-model="paperNew.content"></textarea>
                    </div>
                    <div class="form-group">
                        <button type="button" class="btn btn-default" ng-click="addPaper()">添加论文</button>
                    </div>
                </div>
                <hr/>
                <ul class="edit-person-works">
                    <li ng-repeat="element in paperData track by $index">
                        <div ng-show="editing.papers !== $index">
                            <div class="works-title">
                                <h4>{{element.title}}
                                    <small><a
                                        ng-href='{{element.attachments[0].link + "?download/" + element.attachments[0].name}}'
                                        ng-show='element.attachments[0]!==undefined'
                                        ng-bind="element.attachments[0].name"
                                        target="_blank"></a>
                                    </small>
                                </h4>
                            </div>
                            <div class="works-operation">
                                <a href="javascript:void(0)" ng-click="editPaper(element, $index)">编辑</a>
                                <a href="javascript:void(0)" ng-click="deletePaper(element.id, $index)">删除</a>
                            </div>

                            <div class="clearfix"></div>
                            <p ng-bind="element.content"></p>
                        </div>
                        <div ng-show="editing.papers === $index">
                            <div class="works-title">
                                <div class="form-group">
                                    <input class="form-control" name="paperUpdateTitle"
                                           ng-model="temp.paperUpdate.title" placeholder="论文标题"
                                           ng-class="{'error-input': form.paperUpdateTitle.$invalid}"
                                           required/>
                                </div>
                            </div>
                            <div class="clearfix"></div>
                            <div class="form-group">
                                <meta-single-qnuploader uploader-config="CONFIG.qnuploader"
                                                        uploader-data="temp.paperUpdate.attachments[0]"></meta-single-qnuploader>
                            </div>

                            <div class="form-group">
                                <textarea class="form-control" ng-model="temp.paperUpdate.content"
                                          placeholder="论文详情"></textarea>
                            </div>

                            <div class="form-group">
                                <button type="button" class="btn btn-default"
                                        ng-click="updatePaper(element.id, $index)">保存修改
                                </button>
                                <button type="button" class="btn btn-default" ng-click="cancelPaper()">取消修改</button>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <div class="clearfix"></div>
</form>
